package com.zzyl.nursing.controller.member;

import com.zzyl.common.core.domain.R;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.nursing.domain.NursingProject;
import com.zzyl.nursing.dto.PageNursingProjectDto;
import com.zzyl.nursing.service.IMemberProjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

import static com.zzyl.common.utils.PageUtils.startPage;

@RestController
@RequestMapping("/member/orders/project")
@Api(tags = "老人家属护理项目服务类接口")
public class MemberProjectController {
    @Autowired
    private IMemberProjectService memberProjectService;

    @ApiOperation("分页查询所有护理项目")
    @GetMapping("/page")
    public TableDataInfo<NursingProject> page( PageNursingProjectDto pageNursingProjectDto){
        return memberProjectService.getPage(pageNursingProjectDto);

    }

    @ApiOperation("根据编号查询详细的护理计划信息")
    @GetMapping("/{id}")
    public R<NursingProject> findById(@PathVariable Integer id){
        return R.ok(memberProjectService.findById(id));
  }

}
